import request from '@/utils/request'
// 订单商品券使用
export function availableCouponProdtuct(data) {
  return request({
    url: `/app_api/order/available-coupon-prodtuct`,
    method: 'post',
		data: data
  })
}
// 商品券
export function couponProduct(query) {
  return request({
    url: `/app_api/coupon-product/by-product-id/${query.productId}`,
    method: 'get'
  })
}
// 获取用户优惠券数量
export function couponNumber(query) {
  return request({
    url: '/app_api/coupon/all-coupon-number',
    method: 'get',
		params: query
  })
}
// 我的优惠券
export function couponSelf(query) {
  return request({
    url: `/app_api/coupon/self`,
    method: 'get',
  	params: query
  })
}
// 我的商品优惠券
export function couponProductSelf(query) {
  return request({
    url: `/app_api/coupon-product/self`,
    method: 'get',
  	params: query
  })
}
// 领券中心
export function couponReceiveList(query) {
  return request({
    url: `/app_api/coupon/receive-list`,
    method: 'get',
  	params: query
  })
}
// 领商品券中心
export function couponProductReceiveList(query) {
  return request({
    url: `/app_api/coupon-product/receive-list/${query.regionCode}`,
    method: 'get'
  })
}
// 领取优惠券
export function couponGetOne(query) {
  return request({
    url: `/app_api/${query.productId ? 'coupon-product' : 'coupon'}/get-One/${query.id}`,
    method: 'get'
  })
}
// 领取商品优惠券
export function couponProductGetOne(query) {
  return request({
    url: `/app_api/coupon-product/get-One/${query.id}`,
    method: 'get'
  })
}
// 商城优惠券
export function couponShopList(query) {
  return request({
    url: `/app_api/coupon/shop-list`,
    method: 'get'
  })
}
// 商城商品优惠券
export function couponProductShopList(query) {
  return request({
    url: `/app_api/coupon-product/shop-list`,
    method: 'get'
  })
}